<template>
    <div class="product_list">

        <div class="page_img"></div>
        <div class="header">
            <van-nav-bar class="nav_bar" title="商品易主" left-text="" left-arrow @click-left="handleBack" />
        </div>
        <div style="" class="product_list_serch-text">
            <van-search class="product_list_serch1" v-model="searchValue" shape="round" background="none"
                @focus="showTop = true" >
                <template #left-icon>
                    <div class="search_l_bt"></div>
                </template>
                
            </van-search>
        </div>
        <div class="mongolian_layer" v-show="showTop">
            <div class="mongolian_layer_options">
                <div class="mongolian_layer_div" @click="onSearchs">按供应商搜索</div>
                <div class="mongolian_layer_div" @click="onSearch">按商品名称搜索</div>
            </div>
            <div class="mongolian_layer_layer" @click="showTop = false"></div>
        </div>

        <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
            <van-list v-model:loading="loading" :finished="finished" @load="onLoad">
                <template v-slot:finished>
                    <div class="nothing_div" v-if="list.length == 0 && !refreshing">
                        <van-image :src="nothingData"></van-image>
                        <div class="nothing_font">暂无数据</div>
                    </div>
                </template>
                <div class="product_list_van_list">
                    <div v-for="(item, index) in list" :key="index" class="product_list_van_list_div"
                        :style="{ 'background-color': item.checked ? '#E2F3FF' : '#fff'}">
                        <div class="product_list_van_list_div_left">
                            <van-checkbox v-model="item.checked" icon-size="18px" @change="onCheckboxChange(item, $event)" />
                            <van-image :src="item?.productImages?item?.productImages:icon_imgNull" class="van-image">
                                <template v-slot:error>加载失败</template>
                                <div class="liveStreamingMechanisms" v-if="item.hmMechanismsList[1]?.cooperationMode">
                                </div>
                            </van-image>
                            <div class="div_right" >
                                <div class="div_right_top">
                                    <div class="style_name">
                                        <van-text-ellipsis :content="item.styleName" />
                                    </div>
                                    <div class="status"
                                        :style="computedAtatusColor(auditStatusNameById(item.auditStatus))">{{
                                            auditStatusNameById(item.auditStatus) }}</div>
                                </div>
                                <div class="div_right_center">
                                    <van-text-ellipsis rows="1" :content="item.sellingPoints" />
                                </div>
                                <div class="div_right_bottom">
                                    <div class="price" v-if="item.hmMechanismsList[0]?.cooperationMode == '分佣'"> <span>￥</span>  {{
                                        item.hmMechanismsList[0].price }}</div>
                                    <div class="price" v-if="item.hmMechanismsList[0]?.cooperationMode == '供货'"><span>￥</span> {{
                                        item.hmMechanismsList[0].costPrice }}</div>

                                    <div class="commission" v-if='item.hmMechanismsList[0]?.commission'>
                                        <span class="fonts">佣</span>
                                        <span class="numbers">
                                            {{ (item.hmMechanismsList[0].commission || 0) + "%" }}
                                        </span>
                                    </div>

                                    <div class="money_right"
                                        v-if="item?.hmMechanismsList[0].liveStreamingMechanism">
                                        {{ item?.hmMechanismsList[0].liveStreamingMechanism }}
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- 入库操作 -->
                        <div class="warehousing">
                            <div class="adopt_icon">
                                <div class="adopt_icon_item" :style="{
                                    background:(item.sellStatus == '1'?'#E7FDEE':'#FDE7E7'),
                                    color:(item.sellStatus == '1'?'#19D11B':'#FC2540')
                                    }">
                                    供销合同
                                    <van-image :src="item.sellStatus == '1' ? adopt : adopted"></van-image>
                                </div>
                                <div class="adopt_icon_item" :style="{
                                    background:(qualificationReview(item).status?'#E7FDEE':'#FDE7E7'),
                                    color:(qualificationReview(item).status?'#19D11B':'#FC2540')
                                    }">
                                    核价初审
                                    <van-image :src="qualificationReview(item).img"></van-image>
                                </div>
                                <div class="adopt_icon_item" :style="{
                                    background:(auditReview(item).status == '1'?'#E7FDEE':'#FDE7E7'),
                                    color:(auditReview(item).status == '1'?'#19D11B':'#FC2540')
                                    }">
                                    核价复审
                                    <van-image :src="auditReview(item).img"></van-image>
                                </div>
                                <div class="adopt_icon_item" :style="{
                                    background:(stockReview(item).status == '1'?'#E7FDEE':'#FDE7E7'),
                                    color:(stockReview(item).status == '1'?'#19D11B':'#FC2540')
                                    }">
                                    入库状态
                                    <van-image :src="stockReview(item).img"></van-image>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </van-list>
        </van-pull-refresh>
        <div class="form">
            <van-form @submit="onSubmit">
                <van-cell-group inset>
                    <van-field input-align="right" error-message-align="right" name="recruiterType" label="部门类型"
                        v-model="formData.recruiterType"  readonly placeholder="请选择"
                        @click="showRecruiterType = true" required :rules="[
                            { required: true, trigger: 'onBlur', message: '请选择部门类型' },
                        ]" >
                    <template #right-icon>
                        <van-icon name="arrow" size="3.733333vw" color="#B9BABB"/>
                    </template>    
                    </van-field>
                    <van-popup v-model:show="showRecruiterType" position="bottom">
                        <van-picker title="部门类型" :columns="recruiterTypeColumns" @confirm="recruiterTypeClick"
                            @cancel="showRecruiterType = false" />
                    </van-popup>
                </van-cell-group>
                <van-cell-group inset>
                    <van-field input-align="right" error-message-align="right" name="recruiterDept" label="部门名称"
                        v-model="formData.recruiterDept"  readonly placeholder="请选择"
                        @click="showRecruiterDept = true" required :rules="[
                            { required: true, trigger: 'onBlur', message: '请选择部门' },
                        ]" >
                        <template #right-icon>
                            <van-icon name="arrow" size="3.733333vw" color="#B9BABB"/>
                        </template>   
                    </van-field>
                    <van-popup v-model:show="showRecruiterDept" position="bottom">
                        <van-picker title="部门名称" :columns="recruiterDeptColumns" @confirm="GetUserById"
                            @cancel="showRecruiterDept = false" />
                    </van-popup>
                </van-cell-group>
                <van-cell-group inset>
                    <van-field input-align="right" error-message-align="right" name="recruiter" label="人员名称"
                        v-model="formData.recruiter"  readonly placeholder="请选择" @click="showRecruiter = true"
                        required :rules="[
                            { required: true, trigger: 'onBlur', message: '请选择人员' },
                        ]" >
                        <template #right-icon>
                            <van-icon name="arrow" size="3.733333vw" color="#B9BABB"/>
                        </template>  
                    </van-field>
                    <van-popup v-model:show="showRecruiter" position="bottom">
                        <van-picker title="人员名称" :columns="recruiterColumns" @confirm="onConfirmRecruiter"
                            @cancel="showRecruiter = false" />
                    </van-popup>
                </van-cell-group>
                <div class="form_button">
                    <van-button  block type="primary" color="linear-gradient( 146deg, #0064FF 0%, #008FFF 100%)" native-type="submit" v-throttle:click>
                        变更 ({{ selectedItems.length }})
                    </van-button>
                </div>
            </van-form>
        </div>
    </div>
</template>
<script setup lang="ts">
import { computed, onMounted, ref, watch, onUnmounted } from "vue";
import { listSupplierAddProduct, transferProduct } from "@/api/productList/index";
import { getUserList, queryList } from '@/api/productHome/index'
import { auditStatusNameById } from "@/utils/auditStatusFilter";
import { useRoute, useRouter } from "vue-router";
import { getEnvValue } from "@/utils/index";
import { getInfo } from "@/api/supplierList/index";
import { showSuccessToast, showToast, showConfirmDialog } from "vant";

const formData = ref({
    recruiterType: '',
    recruiterDept: '',
    recruiterDeptId: '',
    recruiter: '',
    recruiterUserId: '',
})
const queryParams = ref<any>({
    pageNum: 1,
    pageSize: 10,
    styleName: "",
    supplierName: ""
});
const showRecruiterType = ref(false)
const showRecruiterDept = ref(false)
const showRecruiter = ref(false)
const recruiterTypeColumns = ref([])
const recruiterDeptColumns = ref([])
const recruiterColumns = ref([])
const nothingData = new URL("@/assets/porduct/icon_zanwushuju.png", import.meta.url).href
const searchValue = ref("");
const serchListActive = ref(0);
const refreshing = ref(false);
const loading = ref(false);
const finished = ref(false);
const list = ref<any[]>([]);
const route = useRoute();
const router = useRouter();
const flag = ref(false);
const showTop = ref(false)

const selectedItems = ref<any[]>([]); // 存储选中的项

const adopt = new URL("@/assets/newui/productList/icon_lvseduihao@2x.png", import.meta.url).href
const adopted = new URL("@/assets/newui/productList/icon_hongsecha@2x.png", import.meta.url).href
const questionMark = new URL("@/assets/newui/productList/icon_hongsewenhao@2x.png", import.meta.url).href
const icon_imgNull = new URL("@/assets/newui/imgNull.jpg", import.meta.url).href;

// 限制连续刷新数据重复问题
const refreFlag = ref(true)
const serchFlag = ref(true)

const defaultPhoneHeight = ref(0) //屏幕默认高度
const nowPhoneHeight = ref(0) //屏幕现在的高度
const productsHeight = ref()
const refreshHeight = ref()
// 在组件挂载完成后添加事件监听器
onMounted(() => {
    defaultPhoneHeight.value = window.innerHeight;
    // 添加事件监听器
    window.addEventListener('resize', handleResize);
    GetDeptList('init', '1861962988832542721')
})
// 处理窗口大小变化的函数
const handleResize = () => {
    nowPhoneHeight.value = window.innerHeight;
};
// 在组件卸载前移除事件监听器
onUnmounted(() => {
    window.removeEventListener('resize', handleResize);
});
const emits = defineEmits(['doShow'])
watch(nowPhoneHeight, () => {
    if (defaultPhoneHeight.value != nowPhoneHeight.value) {
        // 当软键盘弹出,改变bottomIsSHow变量然后去控制bottom的显示与隐藏
        emits('doShow', false)
        productsHeight.value = 'calc(100vh - 11.7vw)'
        refreshHeight.value = 'calc(100vh - 50.4vw)'
    } else {
        // 相等代表软键盘收起后,与上同理
        emits('doShow', true)
        productsHeight.value = 'calc(100vh - 25.0vw)'
        refreshHeight.value = 'calc(100vh - 63.7vw)'
    }
})

/** 资质审核是否审核 */
const qualificationReview = (item: any):any => {
    if (item.qualityLog) {
        if (!item.qualityLog.length) {
            return {
                status:false,
                img:questionMark
            }
        } else if (item.qualityLog.length) {
            // 审核通过
            if (item.qualityLog[0].firstStatus == 11) {
                return {
                    status:true,
                    img:adopt
                }
            } else if (item.qualityLog[0].firstStatus == 8 || item.qualityLog[0].firstStatus == 9 || item.qualityLog[0].firstStatus == 10) {
                
                return {
                    status:false,
                    img:adopted
                }
            } else if (item.qualityLog[0].firstStatus == 7) {
                return {
                    status:false,
                    img:questionMark
                }
            }
        }
    } else {
        return {
            status:false,
            img:questionMark
        }
    }
}
/** 核价是否审核 */
const auditReview = (item: any):any => {
    if (item.pricingLog) {
        if (!item.pricingLog.length) {
            return {
                status:false,
                img:questionMark
            }
        } else if (item.pricingLog.length) {
            // 审核通过
            if (item.pricingLog[0].auditStatus == 13) {
                return {
                    status:true,
                    img:adopt
                }
            } else if (item.pricingLog[0].auditStatus == 12) {
                return {
                    status:false,
                    img:adopted
                }
                
            } else if (item.pricingLog[0].auditStatus == 11) {
                return {
                    status:false,
                    img:questionMark
                }
            }
        }
    } else {
        return {
            status:false,
            img:questionMark
        }
    }
}

const stockReview = (item: any):any => {
    if (item.stockStatus == 4 || item.stockStatus == 0) {
        return {
            status:false,
            img:questionMark
        }
    } else if (item.stockStatus == 2) {
        return {
            status:true,
            img:adopt
        }
    } else if (item.stockStatus == 1) {
        return {
            status:false,
            img:adopted
        }
    } else {
        return {
            status:false,
            img:questionMark
        }
    }
}
/** 设置不同状态不同样式 */
const computedAtatusColor = (name: any) => {
    if (name.includes('待')||name.includes('中')||name.includes('未')) {
        return { backgroundColor: '#EBF4FF', color: '#0094FF' }
    } else if (name.includes('驳回') || name == '已下架' || name == '已退还') {
        return { backgroundColor: '#FDE7E7', color: '#FC2540' }
    } else {
        return { backgroundColor: '#E7FDEE', color: '#19D11B' }
    }
}
/** 选中事件 */
const onCheckboxChange = (item, checked) => {
    if (!checked) {
        const index = selectedItems.value.findIndex(
            (selected) => selected.id === item.id
        );
        if (index !== -1) {
            selectedItems.value.splice(index, 1);
        }
    } else {
        if (selectedItems.value.length < 20) {
            selectedItems.value.push(item);
        } else {
            showToast('最多选择20个商品');
            item.checked = false
        }
    }
};
/** 商品status */
const uniquekey = computed(() => {
    return route.query.id;
});
/** 商品详情回传的auditStatus */
const auditStatus: any = computed(() => {
    return route.query.auditStatus;
});
/** 按商品名称搜索 */
const onSearch = () => {
    showTop.value = false
    queryParams.value.supplierName = '';
    queryParams.value.styleName = searchValue.value;
    onRefresh();
};
/** 按供应商名称搜索 */
const onSearchs = () => {
    showTop.value = false
    queryParams.value.styleName = '';
    queryParams.value.supplierName = searchValue.value;
    onRefresh();
};
/** 查询商品列表 */
const getList = async () => {
    if (uniquekey.value && !flag.value) {
        queryParams.value.auditStatus = uniquekey.value;
        serchListActive.value = Number(uniquekey.value) + 1;
    }
    if (auditStatus.value && !flag.value) {
        queryParams.value.auditStatus = auditStatus.value
        if (auditStatus.value == 10) {
            serchListActive.value = 10
        } else if (auditStatus.value == '-1') {
            serchListActive.value = 11
        } else {
            serchListActive.value = Number(auditStatus.value) + 1;
        }
    }
    const res = await listSupplierAddProduct(queryParams.value);
    res.rows.forEach(async (item) => {
        if (item.productImage) {
            item.productImages = getEnvValue("VITE_APP_PIC_URL") + item.productImage.split(',')[0];
        } else {
            item.productImages = "";
        }
    });
    setTimeout(() => {
        refreFlag.value = true
        // 空数据 停止加载
        if (res.rows.length == 0) {
            list.value = [];
            serchFlag.value = true;
            finished.value = true;
            return;
        }
        // 有数据 赋值列表 加载状态结束
        res.rows.forEach((item) => {
            finished.value = false;
            list.value.push(item);
        });

        list.value.forEach(item => {
            selectedItems.value.forEach(element => {
                if (item.id == element.id) {
                    item.checked = true
                }
            });
        })
        loading.value = false;
        refreshing.value = false;
        serchFlag.value = true;
        // 如果list长度大于等于总数据条数，数据全部加载完成
        if (list.value.length >= res.total) {
            finished.value = true; //结束加载
        }
        // 解决快速切换tab导致的列表商品混乱问题
        if (queryParams.value.pageNum == 2 && queryParams.value.auditStatus) {
            list.value = list.value.filter((item) => {
                return item.auditStatus == queryParams.value.auditStatus
            })
        }

    }, 400);
};
/** 加载更多 */
const onLoad = async () => {
    getList();
    queryParams.value.pageNum++;
};
/** 下拉 */
const onRefresh = () => {
    if (refreFlag.value) {
        refreFlag.value = false
        finished.value = false; // 清空列表数据
        refreshing.value = false;
        loading.value = true; // 加载状态
        queryParams.value.pageNum = 1; // 分页数赋值为1
        list.value = []; // 清空数组
        onLoad(); // 重新加载数据
    } else {
        finished.value = false;
        refreshing.value = false;
    }
};
// 点击部门类型
const recruiterTypeClick = ({ selectedOptions }) => {
    formData.value.recruiterType = selectedOptions[0].text
    GetDeptList('name', selectedOptions[0].value)
    recruiterDeptColumns.value = []
    recruiterColumns.value = []
    showRecruiterType.value = false
    formData.value.recruiterDept = ''
    formData.value.recruiterDeptId = ''
    formData.value.recruiter = ''
    formData.value.recruiterUserId = ''
}
// 获取部门类型列表与部门部门名称列表
const GetDeptList = async (type: string, id: string) => {
    const { data = [] } = await queryList({ parentId: id })
    data.forEach((element) => {
        element.text = element.deptName;
        element.value = element.deptId;
    });
    if (type === 'init') {
        recruiterTypeColumns.value = data
    } else {
        recruiterDeptColumns.value = data
    }
}
// 根据招商部门获取招商员
const GetUserById = async ({ selectedOptions }) => {
    const { rows = [] } = await getUserList({ deptId: selectedOptions[0].value })
    const res = await getInfo()
    const nickName = res.data.user.userName
    rows.forEach((element) => {
        if (nickName == element.nickName) {
            element.disabled = true
        }
        element.text = element.nickName;
        element.value = element.userId;
    });
    recruiterColumns.value = rows
    showRecruiterDept.value = false
    formData.value.recruiterDept = selectedOptions[0].text
    formData.value.recruiterDeptId = selectedOptions[0].value
    formData.value.recruiter = ''
    formData.value.recruiterUserId = ''
}
// 招商员选择
const onConfirmRecruiter = ({ selectedOptions }) => {
    formData.value.recruiter = selectedOptions[0].text
    formData.value.recruiterUserId = selectedOptions[0].value
    showRecruiter.value = false
}
// 变更提交
const onSubmit = () => {
    if (selectedItems.value.length) {
        showConfirmDialog({
            title: '确认更换',
            message: `所选${selectedItems.value.length}件商品将变更招商员为${formData.value.recruiter}`,
        }).then(async () => {
            const ids = selectedItems.value.map(item => item.id)
            let params = {
                productIds: ids,
                ...formData.value
            }
            const list = JSON.parse(JSON.stringify(params));
            await transferProduct(list);
            showSuccessToast({ type: "success", message: "招商员变更成功" });
            router.back();
        });
    } else {
        showToast('最少选择1个商品');
    }
};

/** 返回 */
const handleBack = () => {
    router.push({
        path: '/home/index',
        
    })
}
</script>
<style lang="less" scoped>
.product_list {
    width: 100%;
    height: 100vh;
    background-color: #fff;
    box-sizing: border-box;
    display: flex;
    flex-flow: column;
    position: relative;
    background: url("@/assets/newui/productList/icon_shangpinbeijing@2x.png");
    background-size: 100%;
    background-repeat: no-repeat;

    .page_img {
        background: url("@/assets/newui/productList/icon_shangpintu@2x.png");
        background-size: 100% 100%;
        position: absolute;
        width: 60px;
        height: 60px;
        top: 44px;
        right: 63px;

    }
    .header {
        filter: blur(0px);
        height: 90px;
        padding-top: 44px;
        box-sizing: border-box;
        width: 100%;
        position: relative;
        z-index: 6003;

        :deep(.van-icon-arrow-left) {
        color: #1a1b1c !important;
        }

        :deep(.van-nav-bar__title) {
        color: #1a1b1c !important;
        font-size: 18px !important;
        font-weight: 600 !important;

        }

        :deep(.van-nav-bar) {
        background: none !important;

        &::after {
            display: none !important;
        }
        }

        :deep(.van-nav-bar__content) {
            background-color: transparent !important;
        }
    }

    .product_list_serch-text {
        display: flex;
        align-items: center;
        width: 100%;
        background: #f6faff00;
        height: 50px;
        position: relative;
        margin-top: -10px;
        :deep(.van-search__field) {
            background-color: #fff;
            border-radius: 20px;
            padding-left: 15px;
        }

        :deep(.van-search) {
            background-color: #fff;
            border-radius: 20px;
            padding:0 15px;
        }
        .product_list_serch1 {
            display: flex;
            align-items: center;
            background: #f6faff00;
            width: 100%;
            height: 35px;

            :deep(.van-search__content) {
                padding-left: 0;
                height: 35px;
                border: 1px solid #0094FF;
            }

            :deep(.van-search__field) {
                height: 35px;
            }

            .search_l_bt {
                width: 14px;
                height: 14px;
                background-image: url("@/assets/newui/productList/icon_sousuo@2x.png");
                background-size: 100% 100%;
            }

            .search_r_bt {
                width: 54px;
                height: 26px;
                background: linear-gradient(146deg, #0064FF 0%, #008FFF 100%);
                border-radius: 14px;
                font-weight: 500;
                font-size: 14px;
                color: #FFFFFF;
                line-height: 26px;
                text-align: center;
                transform: translateX(5px);
            }
        }
    }

    .mongolian_layer {
        width: 100%;
        height: calc(100vh - 143px);
        position: absolute;
        top: 130px;

        .mongolian_layer_layer {
            width: 100%;
            height: calc(100% - 60px);
            position: absolute;
            z-index: 6000;
            background: #000000;
            opacity: 0.73;
            margin-top: 60px;

        }

        .mongolian_layer_options {
            width: 100%;
            height: 60px;
            background: #FFFFFF;
            display: flex;
            justify-content: space-around;
            align-items: center;
            position: absolute;
            z-index: 6000;


            .mongolian_layer_div {
                width: 40%;
                height: 30px;
                border-radius: 15px;
                border: 1px solid #0094FF;
                text-align: center;
                font-size: 14px;
                color: #0094FF;
                line-height: 30px;
            }
        }
    }

    .nothing_div {
        width: 100%;
        margin: auto;
        text-align: center;
        margin-top: 20vh;
        font-weight: 400;
        font-size: 12px;
        color: #B8BECA;
        line-height: 12px;
        flex-wrap: wrap;

        .van-image {
            width: 160px;
            height: 160px;
        }
    }

    :deep(.van-pull-refresh) {
        flex: 1;
        overflow: scroll;

        border-radius: 15px 15px 0px 0px;
        background: #fff;
    }

    :deep(.van-text-ellipsis) {
        font-size: 13px !important;
        line-height: 15px !important;
    }

    .product_list_van_list {
        display: flex;
        flex-flow: column;
        background: #f6faff;

        .div_right {
            width: 0;
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-around;

            .div_right_top {
                width: 100%;
                display: flex;
                align-items: center;
                justify-content: space-between;
                padding-left: 10px;
                box-sizing: border-box;

                .status {
                    padding: 0 5px;
                    height: 22px;
                    background: #EBF4FF;
                    border-radius: 5px;
                    text-align: center;
                    line-height: 22px;
                    font-weight: 500;
                    font-size: 12px;
                    color: #0094FF;
                }

                .style_name {
                    font-size: 16px;
                    font-weight: 500;
                    color: #1A1B1C;
                    width: 0px;
                    flex: 1;
                    display: -webkit-box;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    -webkit-line-clamp: 1;
                    -webkit-box-orient: vertical;
                }

                .stats {
                    background: #fde7e7;
                    border-radius: 2px;
                    padding: 3px 13px 3px 13px;
                    font-size: 14px;
                    color: #fc2540;
                    text-align: center;
                    border-radius: 3px;
                }

                .stats1 {
                    background: #ebf4ff;
                    border-radius: 2px;
                    padding: 3px 13px 3px 13px;
                    font-size: 14px;
                    color: #0094ff;
                    text-align: center;
                    border-radius: 3px;
                }

                .stats2 {
                    background: #ebf4ff;
                    border-radius: 2px;
                    padding: 3px 13px 3px 13px;
                    font-size: 14px;
                    color: #0094ff;
                    text-align: center;
                    border-radius: 3px;
                }

                .stats3 {
                    background: #ebf4ff;
                    border-radius: 2px;
                    padding: 3px 13px 3px 13px;
                    font-size: 14px;
                    color: #0094ff;
                    text-align: center;
                    border-radius: 3px;
                }

                .stats4 {
                    background: #ebf4ff;
                    border-radius: 2px;
                    padding: 3px 13px 3px 13px;
                    font-size: 14px;
                    color: #0094ff;
                    text-align: center;
                    border-radius: 3px;
                }

                .stats5 {
                    background: #e7fdee;
                    border-radius: 2px;
                    padding: 3px 13px 3px 13px;
                    font-size: 14px;
                    color: #19d11b;
                    text-align: center;
                    border-radius: 3px;
                }

                .stats6 {
                    background: #ebf4ff;
                    border-radius: 2px;
                    padding: 3px 13px 3px 13px;
                    font-size: 14px;
                    color: #0094ff;
                    text-align: center;
                    border-radius: 3px;
                }

                .stats7 {
                    background: #ebf4ff;
                    border-radius: 2px;
                    padding: 3px 13px 3px 13px;
                    font-size: 14px;
                    color: #0094ff;
                    text-align: center;
                    border-radius: 3px;
                }

                .stats8 {
                    background: #ebf4ff;
                    border-radius: 2px;
                    padding: 3px 13px 3px 13px;
                    font-size: 14px;
                    color: #0094ff;
                    text-align: center;
                    border-radius: 3px;
                }

                .stats9 {
                    background: #ebf4ff;
                    border-radius: 2px;
                    padding: 3px 13px 3px 13px;
                    font-size: 14px;
                    color: #0094ff;
                    text-align: center;
                    border-radius: 3px;
                }

                .stats10 {
                    background: #e7fdee;
                    border-radius: 2px;
                    padding: 3px 13px 3px 13px;
                    font-size: 14px;
                    color: #19d11b;
                    text-align: center;
                    border-radius: 3px;
                }

                .stats11 {
                    background: #fde7e7;
                    border-radius: 2px;
                    padding: 3px 13px 3px 13px;
                    font-size: 14px;
                    color: #fc2540;
                    text-align: center;
                    border-radius: 3px;
                }

            }

            .div_right_center {
                padding-left: 10px;
                width: 100%;
                font-size: 12px;
                color: #8492AD;
                display: -webkit-box;
                overflow: hidden;
                text-overflow: ellipsis;
                box-sizing: border-box;
                -webkit-line-clamp: 1;
                -webkit-box-orient: vertical;
            }

            .div_right_bottom {
                padding-left: 10px;
                box-sizing: border-box;
                display: flex;
                width: 100%;
                align-items: center;
                margin-bottom: 5px;

                .price {
                    font-size: 18px;
                    color: #fc2540;
                    font-weight: 500;
                    white-space: nowrap;
                    span{
                        display: inline-block;
                        margin-right: -6px;
                        font-size: 12px;
                        font-weight: 400;
                    }
                }

                .costPrice {
                    font-size: 11px;
                    color: #a3a3a3;
                    font-weight: 500;
                    white-space: nowrap;
                    margin-left: 10px;
                }

                .commission {
                    
                    background: linear-gradient(136deg, #E9D1A5 0%, #CEA46C 100%);
                    border-radius: 2px;
                    flex-shrink: 0;
                    display: flex;
                    margin-left: 10px;

                    .fonts {
                        width: 22px;
                        // height: 16px;
                        background: #1B1714;
                        text-align: center;
                        line-height: 18px;
                        border-radius: 2px;
                        font-weight: 400;
                        font-size: 12px;
                        color: #CEA46C;
                    }

                    .numbers {
                        min-width: 37px;
                        // height: 16px;
                        background: linear-gradient(136deg, #E9D1A5 0%, #CEA46C 100%);
                        border-radius: 2px;
                        font-weight: 500;
                        font-size: 12px;
                        color: #1B1714;
                        text-align: center;
                        line-height: 18px;
                    }
                }
                .money_right {
                    border-radius: 2px;
                    border: 1px solid #FF5A1A;
                    font-weight: 400;
                    font-size: 12px;
                    color: #FF5A1A;
                    // height: 16px;
                    text-align: center;
                    line-height: 16px;

                    flex-grow: 0;
                    flex-shrink: 1;
                    flex-basis: auto;
                    padding: 0 2px;

                    box-sizing: border-box;

                    overflow: hidden;
                    text-overflow: ellipsis;
                    display: -webkit-box;
                    -webkit-line-clamp: 1;
                    -webkit-box-orient: vertical;
                    margin-left: 10px;

                }

                .anchor {
                    margin-left: auto;
                    padding-left: 15px;
                    font-weight: 400;
                    font-size: 12px;
                    color: #b8beca;
                    //   width: 20%;
                    //   border: 1px solid #ffb0b0;
                    //   padding: 1px 2px;
                    text-align: center;
                    white-space: nowrap;
                    /* 确保文本在一行内显示 */
                    overflow: hidden;
                    /* 隐藏溢出的内容 */
                    text-overflow: ellipsis;
                }
            }

            .liveStreamingMechanism {
                font-size: 11px;
                color: #a3a3a3;
                margin-left: 15px;
                display: flex;
                justify-content: space-between;
                align-items: center;
                width: 100%;
            }
        }

        .warehousing {
            width: 100%;
            display: flex;
            justify-content: space-between;
            flex-direction: row-reverse;
            flex-wrap: wrap;
            margin: 10px 0 0 0;
            box-sizing: border-box;
            padding-left: 5px;

            .adopt_icon {
                width: 100%;
                display: flex;
                align-items: center;
                font-weight: 400;
                font-size: 12px;
                color: #1A1B1C;
                justify-content: space-between;

                .adopt_icon_item {
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    width: 85px;
                    height: 22px;
                    border-radius: 5px;
                    font-weight: 500;
                    font-size: 12px;
                }

                .van-image {
                    width: 12px;
                    height: 12px;
                    margin-left: 5px;
                }
            }

            .warehousing_button {
                width: 84px;
                height: 24px;
                background: #0094FF;
                border-radius: 2px;
                text-align: center;
                font-weight: 400;
                font-size: 14px;
                color: #FFFFFF;
                line-height: 24px;
                margin-top: 5px;
            }
        }
    }

    :deep(.van-search__field) {
        background-color: #fff;
        border-radius: 20px;
        padding-left: 15px;
    }
}

:deep(.van-search__content--round) {
    height: 34px !important;
}

:deep(.van-search__field) {
    height: 34px !important;
}

.liveStreamingMechanisms {
    width: 46px;
    height: 22px;
    background-image: url("@/assets/newui/productList/icon_duojizhi@2x.png");
    background-size: 100% 100%;
    border-radius: 2px 0px 2px 0px;
    position: absolute;
    top: 0px;
    left: 0px;
}



:deep(.van-search__field) {
    background-color: #fff;
    border-radius: 20px;
    padding-left: 15px;
}



@keyframes wrapper-gradient {
    0% {
        top: -1000px;
    }

    100% {
        top: 98px;
    }
}



.van-image {
    width: 120px;
    height: 120px;
    margin-left: 5px;
}

:deep(.van-image__img) {
    border-radius: 5px !important;
}


.product_list_van_list_div {
    display: flex;
    flex-flow: column;
    justify-content: center;
    padding: 10px 10px 8px 6px;
    box-sizing: border-box;
    margin-bottom: 8px;

    .product_list_van_list_div_left {
        width: 100%;
        display: flex;
    }

    .button_div {
        height: 100%;
    }

    .button_list {
        height: 100%;
        display: flex;
        align-items: center;

        .van-image {
            width: 20px;
            height: 20px;
        }

        .parmay {
            width: 70px;
            height: 100%;
            font-size: 14px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        .danger {
            background: #FC2540;
            width: 70px;
            height: 100%;
            font-size: 14px;
            color: #FFFFFF;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
    }
}

:deep(.van-checkbox) {
    overflow: visible;
}

.form {
    box-shadow: 0px 0px 8px 0px rgba(189,195,204,0.5);
    width: 100%;
    padding-bottom: 10px;
    box-sizing: border-box;
    background: #fff;
    position: relative;
    z-index: 3000;

    :deep(.van-cell) {
        padding: 20px 0;
        border-bottom: 1px solid #F3F3FF;
    }
    :deep(.van-field__label) {
       
        color: #464E5D  !important;
    }

    :deep(.van-field__label--required){
        &::before{
            display: none;
        }
        &::after{
            color: var(--van-field-required-mark-color);
            content: "*";
        }
    }

    .form_button {
        padding: 0 15px;
    }
}
</style>